<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>libnetconf: Datastores Usage</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../libnetconf-logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnetconf
   &#160;<span id="projectnumber">0.10.0-146_trunk</span>
   </div>
   <div id="projectbrief">NETCONF Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d1/deb/datastores.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Datastores Usage </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>NETCONF defines usage of three datastores: running (mandatory), startup (optional via :startup capability) and candidate (optional via :candidate capability). libnetconf provides all these datastores.</p>
<p>In addition to the described NETCONF point of view, libnetconf divides all datastores (running, startup and candidate) into datastore parts connected with a specific (basic) configuration data model. Each datastore part is created by <a class="el" href="../../db/d67/group__store.html#ga69009c5985f9eec3a6920f98a6a1a5e6" title="Create a new datastore structure of the specified implementation type. ">ncds_new()</a>, <a class="el" href="../../db/d67/group__store.html#ga18655a18464191a4aab1ef0b7d8ba5df" title="Create a new datastore structure of the specified implementation type with get_state function using l...">ncds_new2()</a> or <a class="el" href="../../d8/d55/group__transapi.html#ga80e69b4cada8c35e5e358287e8af3d85" title="Create new datastore structure with transaction API support. ">ncds_new_transapi()</a> function. According to the specified datastore type, server should set up additional datastore settings (see section <a class="el" href="../../d1/deb/datastores.html#ds_settings">ds_settings</a>). If some specific validation settings are needed, <a class="el" href="../../db/d67/group__store.html#ga4777c16043f5856c5a65bcd20b5ecc31" title="Set validators (or disable validation) on the specified datastore. ">ncds_set_validation()</a> function can be used (more information about validation can be found at a separated <a class="el" href="../../db/df0/validation.html">page</a>. Finnaly, to activate datastore and to get its unique identifier, <a class="el" href="../../db/d67/group__store.html#gaabb1ae2c497726ad826fc6478f97e8ff" title="Activate datastore structure for use. ">ncds_init()</a> function must be called.</p>
<p>If you want to use some data model that extends (by import or augment statement) any of the used data models, functions <a class="el" href="../../db/d67/group__store.html#ga145c9446fad8c350934c21ca86cbaf47" title="Add an configuration data model to the internal list of models. Such model is used to resolve imports...">ncds_add_model()</a> or <a class="el" href="../../db/d67/group__store.html#ga93c65facb061f1048674343ac94a993b" title="Specify a directory path to the location where the required (imported or included) data models can be...">ncds_add_models_path()</a> can be used to specify location of the extension data model(s). As <a class="el" href="../../d8/d55/group__transapi.html#ga80e69b4cada8c35e5e358287e8af3d85" title="Create new datastore structure with transaction API support. ">ncds_new_transapi()</a> connects base data model, its datastore and transAPI module (for more information about transAPI, see <a class="el" href="../../d9/d25/transapi.html">separated page</a>), also an augment model can be connected with a transAPI module using ncds_add_augment_transapi. In both cases, transAPI can be provided not only as a shared object (*.so file), but also statically using <a class="el" href="../../d8/d55/group__transapi.html#gaaf4e4daa7fa8be965ded41eb006a6713" title="Create new datastore structure with transaction API support. ">ncds_new_transapi_static()</a> for base data model and <a class="el" href="../../d8/d55/group__transapi.html#ga7f6f5af711045d8598f283ec09b9167a" title="Extend datastore(s) with an augment model and its transAPI callbacks. ">ncds_add_augment_transapi_static()</a> in case of augment data model.</p>
<p>By default, all features defined in configuration data models are disabled. To enable specific features or all features at once, you can use <a class="el" href="../../db/d67/group__store.html#ga1171ba251d855a3c9abbc57e526739b2" title="Enable usage of the specified feature defined in the specified module. By default, all features are disabled. ">ncds_feature_enable()</a> and <a class="el" href="../../db/d67/group__store.html#ga3c65e57d684b25885d3ccbeb84e9f4d9" title="Enable usage of all features defined in the specified module. By default, all features are disabled...">ncds_features_enableall()</a> functions.</p>
<p>To finish changes made to the datastores (adding augment data models, enabling and disabling features, etc.), server MUST call <a class="el" href="../../db/d67/group__store.html#gab2a27448a52972db6807571590a5c6da" title="Consolidate all internal structures of created data stores and all data models. This function especia...">ncds_consolidate()</a> function.</p>
<p>As a next step, device controlled by the server should be initialized. This should includes copying startup configuration data into the running datastore (and applying them to the current device settings).</p>
<p><a class="anchor" id="ds_settings"></a></p>
<h2>Datastore Settings</h2>
<ul>
<li><p class="startli">Empty Datastore (<em>NCDS_TYPE_EMPTY</em>)</p>
<p class="startli">There is no additional settings for this datastore type.</p>
</li>
<li><p class="startli"><a class="el" href="../../d0/d3b/group__fileds.html">File Datastore</a> (<em>NCDS_TYPE_FILE</em>)</p>
<p class="startli"><a class="el" href="../../d0/d3b/group__fileds.html#gad48955dab497b1258d80019e542acb9b" title="Assign the path of the datastore file into the datastore structure. ">ncds_file_set_path()</a> to set file to store datastore content.</p>
</li>
<li><p class="startli"><a class="el" href="../../da/d64/group__customds.html">Custom Datastore</a> (<em>NCDS_TYPE_CUSTOM</em>)</p>
<p class="startli">This type of datastore implementation is provided by the server, not by libnetconf.</p>
<p class="startli"><a class="el" href="../../da/d64/group__customds.html#ga1e9518d8cc9023c7585fd4de15daa75b" title="Set custom data stored in custom datastore. ">ncds_custom_set_data()</a> sets server specific functions implementing the datastore. In this case, server is required to implement functions from <a class="el" href="../../d0/d28/structncds__custom__funcs.html" title="Public callbacks for the data store. ">ncds_custom_funcs</a> structure. </p>
</li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../da/d1b/usage.html">Using libnetconf</a></li>
    <li class="footer">Generated on Fri Apr 15 2016 09:20:09 for libnetconf by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
